home *** CD-ROM | disk | FTP | other *** search
/ Developer Helper 1: Phil & Dave's Excellent CD / Excellent CD HFS.raw / Moof / Goodies / HyperCard Goodies / HyperCard Dev. ToolKit / XCMD.Sources / Flash.p < prev    next >
Text File  |  1987-08-01  |  1KB  |  66 lines

  1. {$R-}
  2. (*
  3.     flash -- a sample HyperCard external command.
  4.     ©Apple Computer, Inc. 1987
  5.     All Rights Reserved.
  6.  
  7.     To compile and link this file using Macintosh Programmer's Workshop
  8.     (HyperXCmd.p and XCmdGlue.inc must be accessible):
  9.  
  10.     pascal Flash.p
  11.     link -o HyperCommands -rt XCMD=0 -sn Main=Flash Flash.p.o
  12.  
  13.     then use ResEdit to copy the resulting XCMD from HyperCommands
  14.     and paste it into the Home stack, or your own stack.
  15.     
  16.     When you build your own XCMDs, if you need to load 
  17.     "{MPW}"Libraries:interface.o, then say -m ENTRYPOINT in the link statement
  18.     to filter out all routines you don't use.
  19. *)
  20.  
  21. {$S Flash }     { Segment name must be the same as the command name. }
  22.  
  23. UNIT DummyUnit;
  24.  
  25. INTERFACE
  26.  
  27. USES MemTypes, QuickDraw, HyperXCmd;
  28.  
  29. PROCEDURE ENTRYPOINT(paramPtr: XCmdPtr);
  30.     
  31. IMPLEMENTATION
  32.  
  33. TYPE Str31 = String[31];
  34.  
  35. PROCEDURE Flash(paramPtr: XCmdPtr);                             FORWARD;
  36.  
  37.   PROCEDURE ENTRYPOINT(paramPtr: XCmdPtr);
  38.   BEGIN
  39.     Flash(paramPtr);
  40.   END;
  41.  
  42.   PROCEDURE Flash(paramPtr: XCmdPtr);
  43.   VAR flashCount: LongInt;    
  44.       i: INTEGER;
  45.       port: GrafPtr;
  46.       str: Str255;
  47.  
  48.     {$I XCmdGlue.inc }
  49.  
  50.   BEGIN
  51.     ZeroToPas(paramPtr^.params[1]^,str);    { first param is flash count }
  52.     flashCount := StrToNum(str);
  53.     GetPort(port);
  54.     FOR i := 1 TO flashCount DO 
  55.       BEGIN
  56.         InvertRect(port^.portRect);
  57.         InvertRect(port^.portRect);
  58.       END;
  59.   END;
  60.  
  61.  
  62. END.
  63.  
  64.  
  65.  
  66.